<?php
/**
 * 轻云网络验证系统
 * =======================================================
 * 版权所有(C) 2019-2039 daenx.cn，并保留所有权利。
 * 作者：Daen大恩
 * 作者QQ: 1330166565
 * 开发群：661059773
 * =======================================================
 */


//判断是否已安装
if(!is_file("./install/lock") && is_file("./install/index.php")){
	@header("location:install/index.php");
}
include 'data/weby.php';
?>
<?php
include 'head.php';
?>

      <div class="lyear-layout-sidebar-scroll"> 
        
        <nav class="sidebar-main">
          <ul class="nav nav-drawer">
            <li class="nav-item active"> 
            <a href="index.php">
            <i class="mdi mdi-home"></i> 首页</a> 
            </li>
            <li class="nav-item"> 
            <a href="dlqq.php">
            <i class="mdi mdi-account"></i> 代理查询</a> 
            </li>
            <li class="nav-item"> 
            <a href="buy.php">
            <i class="mdi mdi-arrow-down-bold"></i> 自助授权</a> 
            </li>
            <li class="nav-item"> 
            <a href="change.php">
            <i class="mdi mdi-account-settings-variant"></i> 更换授权</a> 
            </li>
			<li class="nav-item"> 
            <a href="javascript:void(0)" onclick="dail()">
            <i class="mdi mdi-account-box"></i> 购买授权</a> 
            </li>
          </ul>
        </nav>
        
        <div class="sidebar-footer">
          <p class="copyright">Copyright &copy; 2020. <a target="_blank" href="http://wpa.qq.com/msgrd?v=3&amp;uin=<?php echo $kfqq; ?>&amp;site=qq&amp;menu=yes"><?php echo $kfname; ?></a></p>
        </div>
      </div>
      
    </aside>
    <!--End 左侧导航-->
    
    <!--头部信息-->
    <header class="lyear-layout-header">
      
      <nav class="navbar navbar-default">
        <div class="topbar">
          
          <div class="topbar-left">
            <div class="lyear-aside-toggler">
              <span class="lyear-toggler-bar"></span>
              <span class="lyear-toggler-bar"></span>
              <span class="lyear-toggler-bar"></span>
            </div>
            <span class="navbar-page-title"> <?php echo $title;?> </span>
          </div>
          
          <ul class="topbar-right">
            <li class="dropdown dropdown-profile">
              <a href="javascript:void(0)" data-toggle="dropdown">
                <span>联系我们 <span class="caret"></span></span>
              </a>
              <ul class="dropdown-menu dropdown-menu-right">
                <li> <a href="http://wpa.qq.com/msgrd?v=3&amp;uin=<?php echo $kfqq; ?>&amp;site=qq&amp;menu=yes"><i class="mdi mdi-delete"></i> 联系作者</a></li>
                <li class="divider"></li>
                <li> <a href="http://wpa.qq.com/msgrd?v=3&amp;uin=<?php echo $kfqq; ?>&amp;site=qq&amp;menu=yes"><i class="mdi mdi-comment-outline"></i> 联系客服</a> </li>
              </ul>
            </li>
    
          </ul>
          
        </div>
      </nav>
      
    </header>
    <!--End 头部信息-->
<main class="lyear-layout-content">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
<div class="card">
<ul class="nav nav-tabs page-tabs">
<li class="active"> <a href="#!">正版查询</a> </li>

</ul>
<form action="?" method="get">
<div class="tab-content">
<div class="tab-pane active">
<div>
<div class="form-group">
<label for="type">查询产品</label>
<div class="form-controls">
 <select name="cp" class="form-control">
 
<?php 
$sql="select * from products ORDER BY `id` DESC";
$result=mysqli_query($con,$sql);
if($result&&mysqli_num_rows($result)){
	while ($row=mysqli_fetch_assoc($result)) {
		if($row['qt']==1){
		echo "<option value='".$row['cp']."'>".$row['cp']."</option>";	}										
	}
}
?>  

</select>
</div>
</div>
<div class="form-group">
<label for="web_site_title">查询QQ</label>
<input type="text" id="qq" name="qq" class="form-control" lay-verType="tips" placeholder="请输入授权的机器人QQ" required/></div>
<hr/>
<button type="submit" onclick="check()" class="btn btn-primary btn-block">点击查询</button>
<?php
//include 'data/config.php';

$get = $_GET[qq];
$ycp = $_GET[cp];

if($get){
	if($ycp==null){echo("<script language=\"javascript\" type=\"text/javascript\" src=\"/data/assets/js/jquery.min.js\"></script><script language=\"javascript\" type=\"text/javascript\" src=\"/data/assets/layer/layer.js\"></script><script>layer.open({  type: 1  ,title: false   ,closeBtn: false  ,area: '200px;'  ,shade: 0.8  ,id: 'LAY_layuipro'   ,resize: false  ,btn: ['确定']  ,moveType: 1   ,content: '<div style=\"padding: 30px; line-height: 22px; background-color: #393D49; color: #fff; font-weight: 300;\"><p style=\"text-align:left;\"><label>请选择要查询的产品</label><br /></p></div>'  ,success: function(layero){ var btn = layero.find('.layui-layer-btn');  btn.find('.layui-layer-btn0').attr({ href: 'index.php' });  }});</script>");die();}
	
	$SQL = "SELECT * FROM `authorize` WHERE `domain`='$get' and `ycp`='$ycp'";
	$query=mysqli_query($con,$SQL);
	while($row =mysqli_fetch_array($query)){
		$domain = $row[domain];
		$name = $row[username];
		$zt = $row[yumi];
		$bz = $row[bz];
		if($zt=="1")
		{$zt = "禁用中";}
		else
		{$zt = "正常";}
if($row['time']==null)
{$timegl = "永久";}
else
if($row['time']==free)
{$timegl = "免费用户";}
else
{$timegl = date("Y-m-d",$row['time']);}
											
	}
	
	if($get != $domain){
	echo("<script language=\"javascript\" type=\"text/javascript\" src=\"/data/assets/js/jquery.min.js\"></script><script language=\"javascript\" type=\"text/javascript\" src=\"/data/assets/layer/layer.js\"></script><script>layer.open({  type: 1  ,title: false   ,closeBtn: false  ,area: '200px;'  ,shade: 0.8  ,id: 'LAY_layuipro'   ,resize: false  ,btn: ['确定']  ,moveType: 1   ,content: '<div style=\"padding: 30px; line-height: 22px; background-color: #393D49; color: #fff; font-weight: 300;\"><p style=\"text-align:left;\"><label>查询账号：</label>".$get."<br /><label>查询产品：</label>".$ycp." &nbsp;&nbsp;<br /><label>查询结果：</label>未授权</p></div>'  ,success: function(layero){ var btn = layero.find('.layui-layer-btn');  btn.find('.layui-layer-btn0').attr({ href: 'index.php' });  }});</script>");
	}
	else{

	echo("<script language=\"javascript\" type=\"text/javascript\" src=\"/data/assets/js/jquery.min.js\"></script><script language=\"javascript\" type=\"text/javascript\" src=\"/data/assets/layer/layer.js\"></script><script>layer.open({  type: 1  ,title: false   ,closeBtn: false  ,area: '200px;'  ,shade: 0.8  ,id: 'LAY_layuipro'   ,resize: false  ,btn: ['确定']  ,moveType: 1   ,content: '<div style=\"padding: 30px; line-height: 22px; background-color: #393D49; color: #fff; font-weight: 300;\"><p style=\"text-align:left;\"><label>查询账号：</label>".$domain."<br /><label>用户名：</label>".$name."<br /><label>状态：</label>".$zt."<br /><label>备注：</label>".$bz."<br /><label>查询产品：</label>".$ycp." &nbsp;&nbsp;<font style=\"color:#FFC125;\"><label>查询结果：</label><font style=\"color:#ADFF2F;\">正版授权</font> &nbsp;&nbsp;<font style=\"color:#FFC125;\"><label>到期时间：</label>".$timegl."</font></p></div>'  ,success: function(layero){ var btn = layero.find('.layui-layer-btn');  btn.find('.layui-layer-btn0').attr({ href: 'index.php' });  }});</script>");
	}
}

?>
<hr/>
</div>
</div>    
</div>
</div>
</form>


<div class="row">
<div class="col-lg-12">
<div class="card">
<div class="card-header">
<h4>官方公告</h4>
</div>
<div class="card-body">
</p>
1、官方文档https://www.kancloud.cn/daen/starfire/1459677</p>
2、使用教程、插件演示都在上面文档里</p>
</div>
</div>
</div>
<script src="/assets/layui.js"></script>
<script type="text/javascript" src="./assets/js/jquery.min.js"></script>
<script type="text/javascript" src="./assets/js/bootstrap.min.js"></script>
<script type="text/javascript" src="./assets/js/perfect-scrollbar.min.js"></script>
<script type="text/javascript" src="./assets/js/main.min.js"></script>
</body>
</html>